3.1.12 \(\int \frac {a-c+b x}{(1+x^2) \sqrt {a+b x+c x^2}} \, dx\) [12]

Optimal. Leaf size=484 \[ -\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \tan ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}}-\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}} \]

[Out]

-1/2*arctan(1/2*(b*(a^2-2*a*c+b^2+c^2)^(1/2)-x*(b^2+(a-c)*(a-c+(a^2-2*a*c+b^2+c^2)^(1/2))))/(a^2-2*a*c+b^2+c^2
)^(1/4)*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(a^2+b^2+c*(c-(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c-(a^2-2*a*c+b^2+c^2)^(1/2))
)^(1/2))*(a^2+b^2+c*(c-(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c-(a^2-2*a*c+b^2+c^2)^(1/2)))^(1/2)/(a^2-2*a*c+b^2+c^2)
^(1/4)*2^(1/2)-1/2*arctanh(1/2*(x*(b^2+(a-c)*(a-c-(a^2-2*a*c+b^2+c^2)^(1/2)))+b*(a^2-2*a*c+b^2+c^2)^(1/2))/(a^
2-2*a*c+b^2+c^2)^(1/4)*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(a^2+b^2+c*(c+(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c+(a^2-2*a*c+
b^2+c^2)^(1/2)))^(1/2))*(a^2+b^2+c*(c+(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c+(a^2-2*a*c+b^2+c^2)^(1/2)))^(1/2)/(a^2
-2*a*c+b^2+c^2)^(1/4)*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 22.90, antiderivative size = 484, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {1050, 1044, 214, 211} \begin {gather*} -\frac {\sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \text {ArcTan}\left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-x \left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2}}-\frac {\sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \tanh ^{-1}\left (\frac {x \left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a - c + b*x)/((1 + x^2)*Sqrt[a + b*x + c*x^2]),x]

[Out]

-((Sqrt[a^2 + b^2 + c*(c - Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c - Sqrt[a^2 + b^2 - 2*a*c + c^2])]*ArcTan[(b
*Sqrt[a^2 + b^2 - 2*a*c + c^2] - (b^2 + (a - c)*(a - c + Sqrt[a^2 + b^2 - 2*a*c + c^2]))*x)/(Sqrt[2]*(a^2 + b^
2 - 2*a*c + c^2)^(1/4)*Sqrt[a^2 + b^2 + c*(c - Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c - Sqrt[a^2 + b^2 - 2*a*
c + c^2])]*Sqrt[a + b*x + c*x^2])])/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4))) - (Sqrt[a^2 + b^2 + c*(c + Sqrt
[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c + Sqrt[a^2 + b^2 - 2*a*c + c^2])]*ArcTanh[(b*Sqrt[a^2 + b^2 - 2*a*c + c^2]
 + (b^2 + (a - c)*(a - c - Sqrt[a^2 + b^2 - 2*a*c + c^2]))*x)/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4)*Sqrt[a^
2 + b^2 + c*(c + Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c + Sqrt[a^2 + b^2 - 2*a*c + c^2])]*Sqrt[a + b*x + c*x^
2])])/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4))

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 1044

Int[((g_) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[-2*
a*g*h, Subst[Int[1/Simp[2*a^2*g*h*c + a*e*x^2, x], x], x, Simp[a*h - g*c*x, x]/Sqrt[d + e*x + f*x^2]], x] /; F
reeQ[{a, c, d, e, f, g, h}, x] && EqQ[a*h^2*e + 2*g*h*(c*d - a*f) - g^2*c*e, 0]

Rule 1050

Int[((g_.) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q
 = Rt[(c*d - a*f)^2 + a*c*e^2, 2]}, Dist[1/(2*q), Int[Simp[(-a)*h*e - g*(c*d - a*f - q) + (h*(c*d - a*f + q) -
 g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] - Dist[1/(2*q), Int[Simp[(-a)*h*e - g*(c*d - a*f + q
) + (h*(c*d - a*f - q) - g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x]] /; FreeQ[{a, c, d, e, f, g,
 h}, x] && NeQ[e^2 - 4*d*f, 0] && NegQ[(-a)*c]

Rubi steps

\begin {align*} \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx &=-\frac {\int \frac {-b^2-(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )-b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx}{2 \sqrt {a^2+b^2-2 a c+c^2}}+\frac {\int \frac {-b^2-(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )+b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx}{2 \sqrt {a^2+b^2-2 a c+c^2}}\\ &=\left (b \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+b x^2} \, dx,x,\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {a+b x+c x^2}}\right )+\left (b \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )+b x^2} \, dx,x,\frac {-b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {a+b x+c x^2}}\right )\\ &=-\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \tan ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}}-\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 0.38, size = 210, normalized size = 0.43 \begin {gather*} \frac {1}{2} \text {RootSum}\left [a^2+b^2-4 b \sqrt {c} \text {$\#$1}-2 a \text {$\#$1}^2+4 c \text {$\#$1}^2+\text {$\#$1}^4\&,\frac {b c \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right )+2 a \sqrt {c} \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right ) \text {$\#$1}-2 c^{3/2} \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right ) \text {$\#$1}-b \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{b \sqrt {c}+a \text {$\#$1}-2 c \text {$\#$1}-\text {$\#$1}^3}\&\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a - c + b*x)/((1 + x^2)*Sqrt[a + b*x + c*x^2]),x]

[Out]

RootSum[a^2 + b^2 - 4*b*Sqrt[c]*#1 - 2*a*#1^2 + 4*c*#1^2 + #1^4 & , (b*c*Log[-(Sqrt[c]*x) + Sqrt[a + b*x + c*x
^2] - #1] + 2*a*Sqrt[c]*Log[-(Sqrt[c]*x) + Sqrt[a + b*x + c*x^2] - #1]*#1 - 2*c^(3/2)*Log[-(Sqrt[c]*x) + Sqrt[
a + b*x + c*x^2] - #1]*#1 - b*Log[-(Sqrt[c]*x) + Sqrt[a + b*x + c*x^2] - #1]*#1^2)/(b*Sqrt[c] + a*#1 - 2*c*#1
- #1^3) & ]/2

________________________________________________________________________________________

Maple [B] result has leaf size over 500,000. Avoiding possible recursion issues.
time = 4.34, size = 6871419, normalized size = 14197.15

method result size
default \(\text {Expression too large to display}\) \(6871419\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

result too large to display

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

integrate((b*x + a - c)/(sqrt(c*x^2 + b*x + a)*(x^2 + 1)), x)

________________________________________________________________________________________

Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {a + b x - c}{\left (x^{2} + 1\right ) \sqrt {a + b x + c x^{2}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x**2+1)/(c*x**2+b*x+a)**(1/2),x)

[Out]

Integral((a + b*x - c)/((x**2 + 1)*sqrt(a + b*x + c*x**2)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a-c)/(x^2+1)/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

integrate((b*x + a - c)/(sqrt(c*x^2 + b*x + a)*(x^2 + 1)), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {a-c+b\,x}{\left (x^2+1\right )\,\sqrt {c\,x^2+b\,x+a}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a - c + b*x)/((x^2 + 1)*(a + b*x + c*x^2)^(1/2)),x)

[Out]

int((a - c + b*x)/((x^2 + 1)*(a + b*x + c*x^2)^(1/2)), x)

________________________________________________________________________________________